﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Text;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using Code.Models;

namespace QianBuo.Lottery.Web.Models
{
    public class PayModels
    {
        public class PayModel
        {
            public PayModel()
            {
                var pays = (Enum.GetValues(typeof(PayType)) as PayType[]).Select(p => p.GetDetail()).Where(p => p.Enable).ToNameValue(p => p.PayType, p => p.Name);
                Pays = new ModelNameValue<PayType, string>(pays);
            }

            [Required(ErrorMessage="输入充值金额")]
            [Range(1,double.MaxValue,ErrorMessage="请输入大于1的金额")]
            public double? Money { get; set; }
            [Required(ErrorMessage="选择支付平台")]
            public PayType PayType { get; set; }
            public string Bank { get; set; }
            public ModelNameValue<PayType, string> Pays { get; set; }
        }

        public class CardPayModel
        {
            [Required(ErrorMessage="*"),RegularExpression(@"\w{32}",ErrorMessage="请输入正确的卡号")]
            public string Number { get; set; }
            [Required(ErrorMessage="*"),RegularExpression(@"\d{6}",ErrorMessage="请输入正确的密码")]
            public string Password { get; set; }
            [Required(ErrorMessage="*")]
            public string CheckCode { get; set; }
        }

        public class ICBC_ManualModel
        {
            public long Order { get; set; }
            public double Money { get; set; }
            public double? SuccessMoney { get; set; }
            public string SiteID { get; set; }
            /// <summary>
            /// 工商银行
            /// </summary>
            public Detail PayDetail { get; set; }


        }

        public class AilPay_ManualModel
        {
            public long Order { get; set; }
            public double Money { get; set; }
            public double? SuccessMoney { get; set; }
            public string SiteID { get; set; }
            /// <summary>
            /// 支付宝
            /// </summary>
            public Detail AilPayDetail { get; set; }

        }
        public class TenPay_ManualModel
        {
            public long Order { get; set; }
            public double Money { get; set; }
            public double? SuccessMoney { get; set; }
            public string SiteID { get; set; }
            /// <summary>
            /// 财付通
            /// </summary>
            public Detail TenPayDetail { get; set; }

        }

       
    }
}